#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll N = 2e5 + 10;
ll a[N];
void solve()
{
    ll n, t, k;
    // 需要讲解的场次、“鸡场”的达成条件、需要小L代讲的总场次。
    cin >> n >> t >> k;
    if (t + k > n)
    {
        cout << 0 << endl;
    }
    else
    {
        ll ans = min((n - k) / t, k + 1);
        cout << ans << endl;
    }
    return;
}
int main()
{
    ll t = 1;
    cin >> t;
    while (t--)
    {
        solve();
    }
    return 0;
}